// show and hide sections of a form
function preparePage() {
	document.getElementById("go").onclick = function() {
		if (document.getElementById("search").value=="")
			document.getElementById("cbp_tmtimeline").style.display = "none";
		 
		else {
		document.getElementById("cbp_tmtimeline").style.display = "block";
		var newListItem = document.createElement("li");
		newListItem.innerHTML = document.getElementById("search").value;
		document.getElementById("savinglist").appendChild(newListItem);
		}
		}
	};

function selectall() {
	document.getElementById("selectall").onclick = function() {
		if (document.getElementById("selectall").checked)
			{ var array = document.getElementsByName("select");
			for(var i = 0 ; i<array.length; i++)
			{
				array[i].checked=true;
			}
		}

		else{
			var array = document.getElementsByName("select");
			for(var i = 0 ; i<array.length; i++)
			{
				array[i].checked=false;
			}
		}
		}
	};

	

window.onload =  function() {
	preparePage();
	selectall();

};

